---@class Battle.BuffShowEffect :Battle.EffectBase
local BuffShowEffect = Battle.CreateClass("BuffShowEffect",Battle.EffectBase)
Battle.BuffShowEffect = BuffShowEffect

---@param buff Battle.Buffer
function BuffShowEffect:BindBuff(buff)
    self.bindId = buff.buffId
    Battle.GlobalEventSystem.Register(Battle.Event.BuffDestroy,self.BuffDie,self)
    self.actor = Battle.ActorManager.GetActor(buff.targetId)
    self:SetTranParent(self.actor.gameObjectSystem:GetTran())
end
---@param args Battle.BufferArgs
function BuffShowEffect:BuffDie(args)
    if args.buff.buffId ~= self.bindId then return end
    self:Die()
end
function BuffShowEffect:Die()
    Battle.GlobalEventSystem.UnRegister(Battle.Event.BuffDestroy,self.Die,self)
    if self.isShowStroke then
        self.actor.gameObjectSystem:ShowOutLine(false)
    end
    Battle.EffectBase.Die(self)
end
return BuffShowEffect